number = int(input('请输入数字：'))

sum = 0
counter = 1
while counter <= number:
    middle = 1
    cnt = 1
    while cnt <= counter:
        middle *= cnt
        cnt += 1
    sum += middle
    counter += 1

print(sum)